%include "io.inc"

;; 定义宏 IFXNEY，用来比较两个数是否不相等，如果不相等则跳转到指定 label
%MACRO IFXNEY 3
    mov eax, dword [%1]
    cmp eax, dword [%2]
    jne %3           ;; jump to %3 if eax (essential [%1]) is not equal to [%2]
%ENDMACRO

;; 定义常量
;; more at https://ncona.com/2019/02/assembly-variables-instructions-and-addressing-modes/
section .data
X dd 15              ;; 创建 4 字节常量 X，值为 10
Y dd 15              ;; dw, dd, dq

section .text
global main
main:
    IFXNEY X, Y, M1
    PRINT_STRING "equal"
    jmp M2
M1:
    PRINT_STRING "not equal"
M2:
    xor eax, eax
    ret